// 类的访问修饰符
export {};
class Person {
  public name: string;
  private age: number;
  protected gender: boolean;
  constructor(name: string, age: number) {
    this.name = name;
    this.age = age;
    this.gender = true;
  }

  sayHi(msg: string): void {
    console.log("I am ${this.name},${this.age}");
  }
}

class Student extends Person {
  private constructor(name: string, age: number) {
    super(name, age);
    console.log(this.gender);
  }

  static create(name: string, age: number) {
    return new Student(name, age);
  }
}

const tom = new Person("tom", 18);
console.log(tom.name);
// console.log(tom.age);// age为私有成员
// console.log(tom.gender);

// const jack = new Student(); // private只允许在内部使用
const jack = Student.create("jack", 18); // 通过static访问
